package com.example.stuasist;

import com.example.stuasist.db.stuasistDbOpenHelper;
import com.example.stuasist.db.dao.CourseDao;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.Button;

public class take_in extends Activity implements OnClickListener {
	private Button take_in_bt_return = null;
	private Button take_in_bt_ok;
	private Button take_in_bt_no;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE); // 去掉标题栏
		super.setContentView(R.layout.take_in);
		this.take_in_bt_return = (Button) findViewById(R.id.take_in_bt_return);
		take_in_bt_ok = (Button) findViewById(R.id.take_in_bt_ok);
		take_in_bt_no = (Button) findViewById(R.id.take_in_bt_no);
		this.take_in_bt_return.setOnClickListener(new OnClickListenerimp2());
		take_in_bt_ok.setOnClickListener(this);
		take_in_bt_no.setOnClickListener(this);
		

		

	}

	private class OnClickListenerimp2 implements OnClickListener { // 设置单击监听
		@Override
		public void onClick(View view) {
			Intent intent = new Intent(take_in.this, MainActivity.class); // 实现页面跳转
			startActivity(intent);
		}
	}

	public boolean onKeyDown(int keyCode, KeyEvent event) { // 设置监听返回键
		if (keyCode == KeyEvent.KEYCODE_BACK) {
			take_in.this.finish();
			Intent intent = new Intent(take_in.this, MainActivity.class); // 实现页面跳转
			startActivity(intent);
		}
		return false;
	}

	@Override
	public void onClick(View v) {
		Intent intent;
		switch (v.getId()) {
		case R.id.take_in_bt_ok:
			
			System.out.println("take_in_bt_ok");
			stuasistDbOpenHelper helper = new stuasistDbOpenHelper(this);
			
			helper.getReadableDatabase();
			
			CourseDao dao = new CourseDao(this);
			
			dao.add("星期一",1,"","","","","");
			dao.add("星期一",2,"","","","","");
			dao.add("星期一",3,"高数","10:20-11:05","立诚","周书明","1-20");
			dao.add("星期一",4,"高数","11:15-12:00","立诚","周书明","1-20");
			dao.add("星期一",5,"","","","","");
			dao.add("星期一",6,"","","","","");
			dao.add("星期一",7,"","","","","");
			dao.add("星期一",8,"","","","","");
			dao.add("星期一",9,"雅思","18:30-19:15","人文楼","janiet","1-14");
			dao.add("星期一",10,"雅思","19:25-20:10","人文楼","janiet","1-14");
			dao.add("星期一",11,"","","","","");
			dao.add("星期一",12,"","","","","");

			dao.add("星期二",1,"","","","","");
			dao.add("星期二",2,"","","","","");
			dao.add("星期二",3,"软工/系统分析","10:20-11:05","致广","林劼","1-20、单双周");
			dao.add("星期二",4,"软工/系统分析","10:20-11:05","致广","林劼","1-20、单双周");
			dao.add("星期二",5,"英语","14:00-14:45","致广","邓敏容","1-20");
			dao.add("星期二",6,"英语","14:55-15:40","致广","邓敏容","1-20");
			dao.add("星期二",7,"体育","3:50-4:35","师大","老师","1-20");
			dao.add("星期二",8,"体育","3:50-4:35","师大","老师","1-20");
			dao.add("星期二",9,"雅思","18:30-19:15","人文楼","李恩符","1-14");
			dao.add("星期二",10,"雅思","19:25-20:10","人文楼","李恩符","1-14");
			dao.add("星期二",11,"","","","","");
			dao.add("星期二",12,"","","","","");

			dao.add("星期三",1,"软件工程","8:20-9:05","致广","倪友聪","1-20");
			dao.add("星期三",2,"软件工程","9:15-10:00","致广","倪友聪","1-20");
			dao.add("星期三",3,"软件工程","10:20-11:05","致广","倪友聪","1-20");
			dao.add("星期三",4,"软件工程","11:15-12:00","致广","倪友聪","1-20");
			dao.add("星期三",5,"","","","","");
			dao.add("星期三",6,"","","","","");
			dao.add("星期三",7,"","","","","");
			dao.add("星期三",8,"","","","","");
			dao.add("星期三",9,"化学课","18:30-19:15","立诚","刘灿陪","1-15");
			dao.add("星期三",10,"化学课","19:25-20:10","立诚","刘灿陪","1-15");
			dao.add("星期三",11,"网络课程","","","","");
			dao.add("星期三",12,"网络课程","","","","");

			dao.add("星期四",1,"数据库原理","8:20-9:05","致广","郑小健","1-20");
			dao.add("星期四",2,"数据库原理","9:15-10:00","致广","郑小健","1-20");
			dao.add("星期四",3,"系统分析","10:20-11:05","致广","林劼","1-20");
			dao.add("星期四",4,"系统分析","11:15-12:00","致广","林劼","1-20");
			dao.add("星期四",5,"","","","","");
			dao.add("星期四",6,"","","","","");
			dao.add("星期四",7,"系统分析实验","15:50-16:35","软楼","黄伟","1-19");
			dao.add("星期四",8,"系统分析实验","16:45-17:30","软楼","黄伟","1-19");
			dao.add("星期四",9,"","","","","");
			dao.add("星期四",10,"","","","","");
			dao.add("星期四",11,"数据库原理","20:20-21:05","软楼","郑小健","1-20");
			dao.add("星期四",12,"数据库原理","21:15-22:00","软楼","郑小健","1-20");

			dao.add("星期五",1,"","","","","");
			dao.add("星期五",2,"","","","","");
			dao.add("星期五",3,"","","","","");
			dao.add("星期五",4,"","","","","");
			dao.add("星期五",5,"英语课","14:00-14:45","致广","邓敏容","1-20");
			dao.add("星期五",6,"英语课","14:55-15:40","致广","邓敏容","1-20");
			dao.add("星期五",7,"","","","","");
			dao.add("星期五",8,"","","","","");
			dao.add("星期五",9,"","","","","");
			dao.add("星期五",10,"","","","","");
			dao.add("星期五",11,"","","","","");
			dao.add("星期五",12,"","","","","");
			
			dao.add("星期六",1,"","","","","");
			dao.add("星期六",2,"","","","","");
			dao.add("星期六",3,"","","","","");
			dao.add("星期六",4,"","","","","");
			dao.add("星期六",5,"","","","","");
			dao.add("星期六",6,"","","","","");
			dao.add("星期六",7,"","","","","");
			dao.add("星期六",8,"","","","","");
			dao.add("星期六",9,"","","","","");
			dao.add("星期六",10,"","","","","");
			dao.add("星期六",11,"","","","","");
			dao.add("星期六",12,"","","","","");

			dao.add("星期日",1,"","","","","");
			dao.add("星期日",2,"","","","","");
			dao.add("星期日",3,"","","","","");
			dao.add("星期日",4,"","","","","");
			dao.add("星期日",5,"","","","","");
			dao.add("星期日",6,"","","","","");
			dao.add("星期日",7,"","","","","");
			dao.add("星期日",8,"","","","","");
			dao.add("星期日",9,"","","","","");
			dao.add("星期日",10,"","","","","");
			dao.add("星期日",11,"","","","","");
			dao.add("星期日",12,"","","","","");
			
			take_in.this.finish();
			intent = new Intent(take_in.this, MainActivity.class); // 实现页面跳转
			startActivity(intent);

			break;
		case R.id.take_in_bt_no:
			
			System.out.println("take_in_bt_no");
			take_in.this.finish();
			intent = new Intent(take_in.this, MainActivity.class); // 实现页面跳转
			startActivity(intent);

			break;

		}
	}
}
